package File;

import java.io.*;

public class Demo18 {
    public static void main(String[] args) throws FileNotFoundException {
        File file = new File("test1.txt");
        try(OutputStream outputStream = new FileOutputStream(file)) {
            PrintWriter printWriter = new PrintWriter(outputStream);
            printWriter.write("你好\n");
            printWriter.write("hello\n");
            printWriter.flush();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
